const CURRENT_USER = "currentUser";
function setUser(loginName) {
    $.ajax({
        url: `/api/system/user/currentUser/${loginName}`,
        dataType: "json",
        type: "GET",
        success: function (res) {
            res = JSON.stringify(res.data);
            sessionStorage.setItem(CURRENT_USER, res);
        }
    });
}
function getUser() {
    let user = sessionStorage.getItem(CURRENT_USER);
    return user ? JSON.parse(user) : user;
}
function getNowDateStr() {
    let d = new Date();
    let month = d.getMonth() + 1;
    let day = d.getDay();
    let ymd = `${d.getFullYear()}-${month < 10 ? '0' + month: month}-${day < 10 ? '0' + day: day}`;
    let hour = d.getHours();
    let minute = d.getMinutes();
    let second = d.getSeconds();
    let hms = `${hour < 10 ? '0' + hour: hour}:${minute < 10 ? '0' + minute: minute}:${second < 10 ? '0' + second: second}`;
    return `${ymd} ${hms}`;
}